Skip to content

Replacing hideUploadButton param inside SendBox.tsx with disableFileUpload to also hide file upload DropZone as well as button#5508

Merged
OEvgeny merged 25 commits intomicrosoft:mainfrom
JamesNewbyAtMicrosoft:janewby/WebChat
Aug 1, 2025
Merged

Replacing hideUploadButton param inside SendBox.tsx with disableFileUpload to also hide file upload DropZone as well as button#5508
OEvgeny merged 25 commits intomicrosoft:mainfrom
JamesNewbyAtMicrosoft:janewby/WebChat

Conversation

@JamesNewbyAtMicrosoft
Copy link
Copy Markdown
Contributor

@JamesNewbyAtMicrosoft JamesNewbyAtMicrosoft commented Jul 2, 2025

Fixes #

Changelog Entry

  • Replacing hideUploadButton param inside SendBox.tsx with disableFileUpload to also hide file upload DropZone as well as button PR #5508, by @JamesNewbyAtMicrosoft

Description

Currently, if user passes in true for SendBox hideUploadButton param, only the attachment button itself is hidden, but the file dropzone button is not disabled and user can still drag and drop a file to be uploaded. These change are meant to also disable the dropzone so prevent file upload and thereby fully disable webchat's file upload ability, therefore the name change as well.

Design

Specific Changes

Fully replaced all uses of hideUploadButton param with disableFileUpload.
SendBox.tsx - added replaced disableFileUpload boolean to DropZone to additionally prevent file upload when true
hideAttachFileButton.html - renamed and replaced this test (changed to hideAttachFileButtonAndDisableDropZone), adding a test to check for DropZone now showing when disableFileUpload param is true.

-

  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@JamesNewbyAtMicrosoft JamesNewbyAtMicrosoft changed the title adding hideUploadButton boolean to file upload dropzone and adding to… Setting hideUploadButton param inside SendBox.tsx to also hide file upload DropZone Jul 2, 2025
@JamesNewbyAtMicrosoft
Copy link
Copy Markdown
Contributor Author

Description

Currently, if user passes in true for SendBox hideUploadButton param, only the attachment button itself is hidden, but the file dropzone button is not disabled and user can still drag and drop a file to be uploaded. These change is meant to also disable the dropzone so prevent file upload when this param is set to true.

@JamesNewbyAtMicrosoft
Copy link
Copy Markdown
Contributor Author

Specific Changes

SendBox.tsx - added hideUploadButton boolean to DropZone
hideAttachFileButton.html - added test to check for DropZone now showing when hideUploadButton param is true.

@JamesNewbyAtMicrosoft
Copy link
Copy Markdown
Contributor Author

@JamesNewbyAtMicrosoft please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="Microsoft"]

@OEvgeny
Copy link
Copy Markdown
Collaborator

OEvgeny commented Jul 2, 2025

I'm ok with the change, @compulim are you ok, do you think MCS is ok with such?

@OEvgeny
Copy link
Copy Markdown
Collaborator

OEvgeny commented Jul 4, 2025

We don't expect everyone magically to switch to the new option. We should leave the old one with deprecation note mentioning the removal date (to be removed on or later than 2 years from now which is july 2027).

@JamesNewbyAtMicrosoft JamesNewbyAtMicrosoft changed the title Setting hideUploadButton param inside SendBox.tsx to also hide file upload DropZone Replacing hideUploadButton param inside SendBox.tsx with disableFileUpload to also hide file upload DropZone as well as button Jul 7, 2025
@JamesNewbyAtMicrosoft
Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree [company="Microsoft"]

Copy link
Copy Markdown
Collaborator

@OEvgeny OEvgeny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to do some changes in the PR

- change condition to hide upload button even if hideUploadButton is not set
- fix white label layout when button hidden
- revert test changes
- add missing test variants
- changelog touch-ups
@OEvgeny OEvgeny self-requested a review July 14, 2025 18:07
@OEvgeny
Copy link
Copy Markdown
Collaborator

OEvgeny commented Jul 14, 2025

@JamesNewbyAtMicrosoft to pass CLA you should send it without quotes or any other markup AFAIK.

OEvgeny
OEvgeny previously approved these changes Jul 24, 2025
compulim
compulim previously approved these changes Aug 1, 2025
Copy link
Copy Markdown
Contributor

@compulim compulim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking.

@OEvgeny will help verifying console.warn shouldn't show up when styleOptions is up-to-date.

OEvgeny and others added 3 commits August 1, 2025 18:56
Co-authored-by: William Wong <compulim@users.noreply.github.com>
@OEvgeny OEvgeny enabled auto-merge (squash) August 1, 2025 21:07
@OEvgeny OEvgeny merged commit b40ec71 into microsoft:main Aug 1, 2025
48 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants